#ifndef URPPAPPLET_H
#define URPPAPPLET_H

#include <QGraphicsView>
#include <QVariantList>
#include <QGraphicsLinearLayout>
#include <QLabel>
#include <QTimeLine>
#include <QQueue>
#include <QCheckBox>

class PlayPauseButton;
class StreamManager;
class SongItem;
class IdleDetector;

#ifdef PLASMA
#include <Plasma/Applet>

class URPPApplet : public Plasma::Applet {
	Q_OBJECT;
	public:
		void paintInterface(QPainter *painter, const QStyleOptionGraphicsItem *option, const QRect& contentsRect) {}
	protected:
		void resizeEvent(QGraphicsSceneResizeEvent* event);
#else
class URPPApplet : public QGraphicsView {
	Q_OBJECT;
	public:
		URPPApplet(QObject *parent, const QVariantList &args);
	protected:
		void resizeEvent(QResizeEvent* event);
#endif
	public:
		void init();
	private slots:
		void onNewSong(QString artist, QString title);
		void showSettings();
		void onUserIdle();
	private:
		PlayPauseButton* playPauseButton;
		QGraphicsProxyWidget *playPauseButtonProxy, *volumeProxy, *leftProxy;
		QWidget* leftContainer;
		QLabel* settingsLabel;
		StreamManager* streamManager;
		SongItem* centerItem;		
		QGraphicsWidget* topBar;
		bool oddItem;
		IdleDetector* idleDetector;
		QQueue<SongItem*> itemsList;
};

#ifdef PLASMA
	K_EXPORT_PLASMA_APPLET(urpp, URPPApplet)
#endif

#endif
